#include "../include/message.hpp"
#include <cassert>

using namespace easylog;

void print_msg(const message& msg)
{
    std::cout << "   time: " << msg.time                    << std::endl;
    std::cout << "  level: " << level::level2str(msg.levo)  << std::endl;
    std::cout << "   file: " << msg.file                    << std::endl;
    std::cout << "   line: " << msg.line                    << std::endl;
    std::cout << "   func: " << msg.func                    << std::endl;
    std::cout << "    tid: " << msg.tid                     << std::endl;
    std::cout << "   file: " << msg.file                    << std::endl;
    std::cout << "payload: " << msg.payload                 << std::endl;
}

void test_completed_constructor()
{
    std::cout << " ----- completed constructor ----- " << std::endl;
    message msg(level::lv_enum::info, __FILE__, __LINE__, __FUNCTION__, "logger1", "I get a message");
    print_msg(msg);
    std::cout << " ----- --------------------- ----- " << std::endl << std::endl;;
}

void test_half_construct()
{
    std::cout << " ----- half      constructor ----- " << std::endl;
    message msg;
    print_msg(msg);
    std::cout << " ----- --------------------- ----- " << std::endl;
}

void test_template()
{
}

#define TEST \
                1
int main()
{
    switch (TEST)
    {
        case 1: test_completed_constructor(); break;
        case 2: test_half_construct(); break;
        case 3: test_template(); break;
        default: assert(false);
    }

    return 0;
}
